﻿

namespace Mulala.Cavan.Domain.MainBoundedContext.SecurityModule
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.ComponentModel;
    using FluentValidation.Attributes;
    using Mulala.Cavan.Domain.Seedwork;

    [Serializable]
    [Validator(typeof(RoleValidator))]
    public class Role : Persistent
    {
        [DisplayName("名称")]
        public virtual string Name { get;set; }
        [DisplayName("描述")]
        public virtual string Description { get; set; }
        [DisplayName("是否权限受限")]
        public virtual bool IsUseDenied { get; set; }
        public virtual IList<SysController> Controllers { get; set; }
        public virtual IList<SysAction> Actions { get; set; }

        public override string ToDisplay()
        {
            return Name;
        }


        public Role()
        { 
        }

        public Role(int roleID,bool isUseDenied)
        {
            this.ID = roleID;
            this.IsUseDenied = isUseDenied;
        }
    }
}
